/**
 * 功能描述：
 */
define(function (require, exports, module) {
    //引入视图基类
    var ELView = require("elview");

    //assets
    var template = require("./assets/tpl/productBatch_main.tpl");
    require("./assets/css/productBatch_main.css");

    //component
    var cSubnav = require("./component/productBatchSubnav");
    var cGrid = require("./component/productBatchGrid");
    var cForm = require("./component/productBatchForm");

    //service
    var service = require("./service/productBatchSvc");


    var App = ELView.extend({
        attrs: {
            template: template
        },
        service: service,
        initComponent: function (params, widget) {
            //初始化组件
            cSubnav.initComponent(widget);
            cGrid.initComponent(widget);
            cForm.initComponent(widget);
        },
        toCard: function(){
            this.hide([".J-grid"]).show([".J-form"]);
            this.get("subnav").hide(["search","add","seal"]).show(["return"]);
        },
        toList: function(){
            this.hide([".J-form"]).show(".J-grid");
            this.get("subnav").hide(["return"]).show(["search","add","seal"]);
        }
    });

    module.exports = App;
});